import request from '@/utils/request'

// 查询学生贷款列表
export function listData(query) {
  return request({
    url: '/hsien/contract/data/list',
    method: 'get',
    params: query
  })
}

// 查询学生贷款详细
export function getData(contractId) {
  return request({
    url: '/hsien/contract/data/' + contractId,
    method: 'get'
  })
}

// 查询学生贷款详细 因为getData重复问题
export function getContractDataById(contractId) {
  return request({
    url: '/hsien/contract/data/' + contractId,
    method: 'get'
  })
}

// 获取最新添加的一条记录
export function selectNewCreateByFirstName(firstName) {
  return request({
    url: '/hsien/contract/data/newOne/' + firstName,
    method: 'get',
    params: firstName
  })
}

// 新增学生贷款
export function addData(data) {
  return request({
    url: '/hsien/contract/data',
    method: 'post',
    data: data
  })
}

// 修改学生贷款
export function updateData(data) {
  return request({
    url: '/hsien/contract/data',
    method: 'put',
    data: data
  })
}

// 删除学生贷款
export function delData(contractId) {
  return request({
    url: '/hsien/contract/data/' + contractId,
    method: 'delete'
  })
}

// 导出学生贷款
export function exportData(query) {
  return request({
    url: '/hsien/contract/data/export',
    method: 'get',
    params: query
  })
}
